@layout("/common/_curd/_container.html"){

	<form class="form-horizontal" role="form">
		<!-- 表单 -->
		@ var _col=[
		@			  {name:"供应商", index:"name", type:"text",newline:true,length:8},
		@			  {name:"地址", index:"address", type:"text",newline:true,length:8},
		@			  {name:"证件号", index:"code", type:"text",newline:true,length:8},
		@			  {name:"联系人", index:"concat", type:"text",newline:true,length:3},
		@			  {name:"联系方式", index:"tel", type:"text",newline:false,length:3}
		@		   ];
		@ include("/common/_curd/_view.html", {"col":_col}){}






		<!-- 按钮 -->

	</form>



<script type="text/javascript">
    var ctx = "${basePath}";
    var grid_selector = "#grid-table";
    var pager_selector = "#grid-pager";

    $(function(){
        initGrid();
        initMenuBtn("btns", "${code}");
    });

    function initGrid(){
        var grid_url = ctx + "/product/list";
        var _colnames = ["",
            "商品名",
            "供应商",
            "商品类型",
            "商品规格",
            "生产厂家",
            "条码编号",
            "产地",
            "保质期",
//						"图片",
            "单价"];
        var _colmodel = [{name:"id", index:"id",hidden:true, width:100},
            {name:"name", index:"name", width:100},
            {name:"sname", index:"sname",hidden:true, width:100},
            {name:"type", index:"type", width:100},
            {name:"unit", index:"unit", width:100},
            {name:"factory", index:"factory", width:100},
            {name:"code", index:"code", width:100},
            {name:"address", index:"address", width:100},
            {name:"quality", index:"quality", width:100},
//						{name:"pic", index:"pic", width:100},
            {name:"money", index:"money", width:100}];

        jQuery(grid_selector).jqGrid({
            url : grid_url,
            shrinkToFit : true,
            colNames : _colnames,
            colModel : _colmodel,
            jsonReader : {id :"id"},
            pager : pager_selector,
            postData : {sort : "id",
				where:"{s_id:"+${id}+"}",
				order : "desc"}
        });
    }
</script>


<!-- 配置 grid -->
<div class="row">
	<div class="col-xs-12 tb-grid">
		<!-- 按钮 -->
		<!--<div class="welljq well-sm" id="btns"></div>-->
		<!-- grid -->
		<table id="grid-table"></table>
		<!-- 分页-->
		<div id="grid-pager"></div>
	</div>
</div>

<!-- 引入所需的js -->
@include("/common/_listscript.html"){}

@ include("/common/_curd/_btn.html", {btn_close:"关闭"}) {}
@}
